package com.qust.endecryptionmanager.exception.handle;

import com.qust.agreement.result.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import java.sql.SQLIntegrityConstraintViolationException;
@ControllerAdvice
@ResponseBody
public class GlobalExceptionHandler {

    @ExceptionHandler({SQLIntegrityConstraintViolationException.class})
    public Result<?> SQLExceptionHandle(){
        return Result.failed("算法名重复,请重新输入算法名称");
    }

}
